/**
 * @file customer_controller.h
 * @author ningyi 2025
 * @author modified by neozng
 * @brief  自定义控制器发送模块定义头文件
 * @version beta
 * @date 2025-03-11
 *
 * @copyright Copyright (c) ningyi 2025 corp
 * @copyright Copyright (c) 2022 HNU YueLu EC all rights reserved
 *
 */

#ifndef CUSTOMER_CONTROLLER_H
#define CUSTOMER_CONTROLLER_H



#include <stdint.h>
#include "main.h"
#include "usart.h"


#pragma pack(1) // 压缩结构体,取消字节对齐,下面的数据都可能被传输

typedef struct
{
    float joint_1_angle ;
    float joint_2_angle ;
    float joint_3_angle ;
    float joint_4_angle ;
    float joint_5_angle ;
    float joint_6_angle ;
	uint16_t reserve1   ;
	uint16_t reserve2   ;
	uint16_t reserve3   ;
} CC_ctrl_t;

#pragma pack() // 开启字节对齐,结束前面的#pragma pack(1)



/**
 * @brief 初始化遥控器,该函数会将遥控器注册到串口
 *
 * @attention 注意分配正确的串口硬件,遥控器在C板上使用USART3
 *
 */
CC_ctrl_t *Customer_Controller_Init(UART_HandleTypeDef *rc_usart_handle);

void Customer_Controller_Send(uint8_t *tx_data);

#endif